<!-- 公共的子组件 !-->
<template>
<!-- 分页 -->
  <div id="paging" class="paging">
    <el-pagination
      background
      :page-size="5"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage"
      layout="total, prev, pager, next, jumper"
      :total="total"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  props: ["total"],
  name: "paging",
  data() {
    return {
      currentPage: 5,
    };
  },
  created() {},
  computed: {},
  components: {},
  methods: {
    // 分页派发事件给需要分页的父组件
    handleCurrentChange(val) {
      this.$emit("sorter", val);
    },
  },
  mounted() {},
  watch: {},
};
</script>
<style scoped >
</style>